
#include "TimeDirichletBC.h"
#include "Function.h"

registerMooseObject("TrilobitaApp", TimeDirichletBC);

defineLegacyParams(TimeDirichletBC);

InputParameters
TimeDirichletBC::validParams()
{
    InputParameters params = DirichletBCBase::validParams();
    params.addRequiredParam<std::vector<Real> >("time_list", "time list");
    params.addRequiredParam<std::vector<Real> >("value_list", "value list");
  
    return params;
}

TimeDirichletBC::TimeDirichletBC(const InputParameters& parameters)
    : DirichletBCBase(parameters)
{
    _time_list = getParam<std::vector<Real>>("time_list");
    _value_list = getParam<std::vector<Real>>("value_list");
    _func_value_t = LinearInterpolation(_time_list, _value_list);
}

Real
TimeDirichletBC::computeQpValue()
{
    return _func_value_t.sample(_t);
}
